const mongoose=require('mongoose');


//数据库开启连接
function  dbConnect() {
  mongoose.connect('mongodb://localhost/shoponline');
  mongoose.connection.once('open',function(err){
    if(err){
      console.log('not openning');
    }else{
      console.log('is opening');
    }
  })
}

exports.dbConnect=dbConnect;